home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / logchk10.zip / LOGCHECK.DOC < prev    next >
Text File  |  1992-08-17  |  4KB  |  114 lines

  1.  
  2.  
  3. LOGCHECK -- Checks log files for strings         Alton Moore
  4.             which signify good or failed         Fidonet 1:397/5264 (NEC)
  5.             net connections in batch.            WWIVnet 1@1042
  6.  
  7. Version 1.0, 08/16/1992
  8.  
  9. ---------------------------------------------------------------------------
  10.  
  11.  
  12. INTRODUCTION:
  13. -------------
  14. This program is intended to determine whether a network transfer occurred
  15. (say at least once per night) by scanning a network log file for a
  16. specified string.  The addition to the log of text containing this string
  17. causes the program to exit with a certain error level, which you may use
  18. in your batch files to determine whether the network transfer just
  19. attempted was successful.
  20.  
  21. Although this program is not network-specific in any way, I will
  22. generally give examples for a FrontDoor/WWIV setup.
  23.  
  24.  
  25. THEORY OF OPERATION:
  26. --------------------
  27. The program will perform 2 functions: marking the current size of a given
  28. log file and checking that file for the addition of text containing a
  29. target string (say "connected").  These functions are meant to be used
  30. before and after a network transfer attempt to determine whether the
  31. attempt was successful.  These functions, in conjunction with a flag
  32. file, can be used to ensure that, for example, your system calls another
  33. system at least once per night.  The first step would be to create a flag
  34. file (probably in batch) as soon as you want your system to start trying
  35. to call the target system.  You would create an event which created your
  36. flag file:
  37.  
  38. .
  39. .
  40. echo  This file's presence causes my FrontDoor batch file to do a WWIV callout!
  41.         >\bbs-util\wwiv1040.flg    <--- continuation of previous line
  42. .
  43. .
  44.  
  45.  
  46. Then, at some point in your batch file which is often traveled by your system,
  47. for example just after every net connection or human caller, you might put:
  48.  
  49. .
  50. .
  51. if exist \bbs-util\wwiv1040.flg  goto wwiv_callout
  52. .
  53. .
  54.  
  55.  
  56. And then, the actual callout code:
  57.  
  58. :wwiv_callout
  59. cd \wwiv
  60. \wwiv\utility\logcheck -m \wwiv\gfiles\netdat0.log
  61. \wwiv\utility\clout.exe 1040 1
  62. \wwiv\utility\logcheck -p 5
  63. \wwiv\utility\logcheck -s connected
  64. if errorlevel 1  goto run_frontdoor
  65. del \bbs-util\wwiv1040.flg
  66. goto run_frontdoor
  67.  
  68.  
  69. Note that above, in the first invocation of the program, -m is used as
  70. the first argument to indicate storing the name of the file we're
  71. referring to (supplied as the second argument) as the first line of the
  72. holding file logcheck.dat and the current size as the second line.
  73.  
  74. The -p invocation prints out the addition to the log file to the screen,
  75. pausing for 5 seconds to let you get a gander at the results!
  76.  
  77. The next invocation (scan, indicated by -s) scans the file stored as
  78. the first line of logcheck.dat, starting at the byte indicated by the
  79. second line of logcheck.dat.  The second argument is the string to scan
  80. for (use quotes to encapsulate strings with odd characters or spaces).
  81. If the string is found, then error code 0 is returned; if not, then 1 is.
  82.  
  83.  
  84.  
  85. SYNTAX:
  86. -------
  87. Run the program with no arguments for the latest help information.
  88.  
  89. The functions supported by the program are:
  90.   -m [logfilespec]      remembers the filespec of the log file
  91.                          and the current size and stores them.
  92.   -s [stringtoscanfor]  returns 0 if this string was found to be added to
  93.                          the file since the last mark operation.
  94.   -p [delaytime]        prints the new part of the log to the screen,
  95.                          pausing for [delaytime] afterwards.
  96.  
  97.  
  98. The error codes returned by the program are:
  99.   -m function:  0 = successful
  100.                 2 = bad parameter (function or filename)
  101.   -s function:  0 = successful (string found in new part of log file),
  102.                 1 = unsuccessful (log file same size or smaller or string
  103.                      not found in new part of log file)
  104.                 2 = bad parameter (function or filename)
  105.   -p function:  Oh, just look at the source....
  106.  
  107. ---------------------------------------------------------------------------
  108.  
  109. Well, if you are totally confused by now, I don't blame you.  Drop me a
  110. line (at either address listed above) explaining your situation and I'll
  111. try to help.
  112.                                              Alton Moore
  113.  
  114.